Skip to content

fix(app-jshint): improve jshint usage #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2014

Conversation

kingcody
Copy link
Member

Changes:

  • Update jshint task in Gruntfile.js to include serverTest
  • Add server/.jshintrc-spec that extends server/.jshintrc with spec globals
  • Use "latedef": "nofunc" instead of "latedef": true in server/.jshintrc
  • Add assertion for jshint task in generator tests for defaultOptions
  • Fix pre exsisting lint errors in server and client
  • Change getEmail() in client/app/account/settings/settings.controller to use user arg and not $scope.user

Closes #463, #486

@DaftMonk
Copy link
Member

Instead of defining describe, it, before, beforeEach, after, afterEach as globals in each test, maybe it would be better to add those to the .jshintrc file?

@kingcody
Copy link
Member Author

I actually did at first, but then I was worried about defining globals for all the server files. Do you think that it should not cause a problem?

@kingcody
Copy link
Member Author

How about a .spec.jshintrc with globals set, maybe something like that?

@DaftMonk
Copy link
Member

Well that's what we're currently doing for the client side jshint.

I guess we could have a jshint specifically for tests. Not really sure what it should be called. Maybe .jshintrc-spec?

We could use the "extends" option in jshint to extend the default jshint file, and make it a bit more dry.

@kingcody
Copy link
Member Author

That sounds like a good thing... would you be so kind as to point it out to me? I can't seem to find "extends" in the docs for grunt-contrib-jshint or jshint for that matter. Perhaps I'm just lost :)

@DaftMonk
Copy link
Member

jshint/jshint#1314

I don't see any documentation on it, but you can see that angular.js is using it in their .jshintrc

@kingcody
Copy link
Member Author

Awesome! Done.

@kingcody kingcody force-pushed the fix/jshint branch 2 times, most recently from 00a7543 to 13ebc85 Compare August 25, 2014 07:42
@kingcody kingcody changed the title fix(app-jshint): recursively lint server code fix(app-jshint): improve jshint usage Aug 25, 2014
@kingcody
Copy link
Member Author

@DaftMonk please take a look at client/app/account/settings/setting.controller, I took some liberties there. I think that you or @chester1000 might want to approve that.

Changes:
- Update jshint task in `Gruntfile.js` to include `serverTest`
- Add `server/.jshintrc-spec` that extends `server/.jshintrc` with spec globals
- Use `"latedef": "nofunc"` instead of `"latedef": true` in `server/.jshintrc`
- Add assertion for `jshint` task in generator tests for `defaultOptions`
- Fix pre exsisting lint errors in `server` and `client`
- Change `getEmail()` in `client/app/account/settings/settings.controller` to use `user` arg and not `$scope.user`

Closes angular-fullstack#463, angular-fullstack#486
@kingcody kingcody mentioned this pull request Aug 25, 2014
DaftMonk added a commit that referenced this pull request Aug 26, 2014
fix(app-jshint): improve jshint usage
@DaftMonk DaftMonk merged commit 0622df2 into angular-fullstack:master Aug 26, 2014
@kingcody kingcody deleted the fix/jshint branch August 30, 2014 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'grunt jshint:server' ignores deep server/api files
3 participants